<template>
  <div class="dash">
    <TitleBar
      title="支付设置"
      refresh
    />
    <!-- form -->
    <div class="conten">
      <div class="top">
        <p
          class="dat"
          style="
font-size:14px;
font-family:PingFangSC-Semibold;
font-weight:600;
color:rgba(51,51,51,1);"
        >数据列表</p>
      </div>
      <el-table
        :data="dataList"
        :header-cell-style="{
          'height':'56px',
          'background':'#F2F2F2',
        }"
        style="width: 100%;border:1px solid #E6E6E6;padding-bottom:59px;margin-bottom:59px"
      >
        <el-table-column label="支付方式名称" align="center">
          <template slot-scope="scope">
            <span style="float:left; width:100%;text-align:center;">{{ scope.row.payTypeName }}</span>
          </template>
        </el-table-column>
        <el-table-column label="支付方式描述" align="center">
          <template slot-scope="scope">
            <div slot="reference" class="name-wrapper">
              <span style="display:block;width:100%;text-align:center;">{{ scope.row.describes }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="是否启用" align="center">
          <template slot-scope="scope">
            <span style="display:block;width:100%;text-align:center;">{{ scope.row.olState=='1'?'启用':'-' }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" >
          <template slot-scope="scope">
            <span style="display:block;width:100%;text-align:center;" @click="payForEditing(scope.row.payTypeCode)">编辑</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getPay } from '@/api/setting.js'
import { constants } from 'crypto'
export default {
  data() {
    return {
      dataList: [],
      dataTotal: ''
    }
  },
  created() {
    this.initList()
  },
  methods: {
    // 初始化
    initList() {
      getPay({
      }).then(res => {
        this.dataList = res.data
      })
    },
    payForEditing(code) {
      this.$router.push({
        name: `payForEditing`,
        query: {
          code
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.dash{
  padding: 0 144px 0 22px;
}
</style>
